package cn.ransj.animation.util;

import java.util.Random;

import android.view.animation.Animation;
import android.view.animation.ScaleAnimation;

/**
 * scale animation utils
 * 
 * @author android
 * 
 */
class ScaleUtil implements AnimInterface {
	private static final String TAG = ScaleUtil.class.getSimpleName();
	// x,y,toX,toY
	private static final float ACTIONS[][] = { { 0, 0, 1, 1 }, { 1, 1, 0, 0 }, };
	private Random mRandom;
	private int mActionLength;

	public void init() {
		mRandom = new Random();
		mActionLength = ACTIONS.length;
	}

	public Animation random() {
		int index = mRandom.nextInt(mActionLength);
		return new ScaleAnimation(ACTIONS[index][0], ACTIONS[index][2],
				ACTIONS[index][1], ACTIONS[index][3],
				Animation.RELATIVE_TO_SELF, (float) 0.5,
				Animation.RELATIVE_TO_SELF, (float) 0.5);
	}

}
